STY: Prefer using pytest temporary path fixtures in tests - #137
Open
jhlegarreta wants to merge 1 commit into
Open
STY: Prefer using pytest temporary path fixtures in tests#137jhlegarreta wants to merge 1 commit into
pytest temporary path fixtures in tests#137jhlegarreta wants to merge 1 commit into
Conversation
jhlegarreta
force-pushed
the
sty/pytest-temp-path-fixture-leftbehind
branch
7 times, most recently
from
August 26, 2026 19:19
6b4c7f1 to
d07d3e1
Compare
Prefer using the `pytest` `tmp_path` fixture in tests over the standard library `tempfile.TemporaryDirectory()`. In the previous implementation, the context was ensuring that the memmap files did not live past the context, failing to check anything that the `trx` function at issue would do in terms of the file survival. Since `close_or_delete_mmap` does not actually delete the file, and `test_close_or_delete_mmap_with_mmap_attr` actually checks that the memmap has been closed, this patch set checks that the file is still present after calling the function; `pytest` takes care of deleting the file once the testing function has finished its execution. Left behind in commit 25cc109.
jhlegarreta
force-pushed
the
sty/pytest-temp-path-fixture-leftbehind
branch
from
August 26, 2026 19:27
d07d3e1 to
c7a97e2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #137 +/- ##
==========================================
- Coverage 86.49% 86.46% -0.03%
==========================================
Files 13 13
Lines 2887 2881 -6
==========================================
- Hits 2497 2491 -6
Misses 390 390
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prefer using the
pytesttmp_pathfixture in tests over the standard librarytempfile.TemporaryDirectory().In the previous implementation, the context was ensuring that the memmap files did not live past the context, failing to check anything that the
trxfunction at issue would do in terms of the file survival. Sinceclose_or_delete_mmapdoes not actually delete the file, andtest_close_or_delete_mmap_with_mmap_attractually checks that the memmap has been closed, this patch set checks that the file is still present after calling the function;pytesttakes care of deleting the file once the testing function has finished its execution.Left behind in commit 25cc109.